<?php
include("funciones.php");
$connection = conectaDB();

$sql = "select Id_usuario,login
		FROM usuario
		WHERE login REGEXP BINARY '^".$_POST['txt_usuario']."' AND contrasena REGEXP BINARY '^".$_POST['txt_password']."'";
		$result = mysql_query($sql,$connection);
		$rows = mysql_num_rows($result);
			if ( $rows>0 )
			{
			        $row = mysql_fetch_row($result);
    				session_start();
			        $_SESSION['id_usuario'] = 			$row[0];
			        $_SESSION['login'] = 				$row[1];
			        
			    echo 1;
			}
			else
			{
				echo 2;
			}
?>
